%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-relational/basics-with-fragments"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 6, 8, 9, 10<br />2: PgSelectInlineApply[116]<br />3: PgSelect[7]<br />ᐳ: Access[117]<br />4: PgSelectRows[11]"):::bucket
    Bucket1("Bucket 1 (listItem)<br />Deps: 117, 10<br /><br />ROOT __Item{1}ᐸ11ᐳ[12]"):::bucket
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 13, 117, 12, 10<br /><br />ROOT PgSelectSingle{1}ᐸpeopleᐳ[13]<br />1: <br />ᐳ: 14, 118, 119<br />2: PgSelectRows[20]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 10<br /><br />ROOT __Item{3}ᐸ20ᐳ[21]"):::bucket
    Bucket4("Bucket 4 (polymorphic)<br />__typename: Lambda[26]<br />Deps: 26, 10, 23, 25, 77, 82, 87, 92, 97, 102"):::bucket
    Bucket5("Bucket 5 (polymorphicPartition)<br />|RelationalTopic<br />Deps: 10, 23, 25, 77, 82, 87, 92, 97, 102<br />ᐳRelationalTopic<br /><br />1: PgSelect[28]<br />2: PgSelectRows[33]<br />ᐳ: 32, 34, 107"):::bucket
    Bucket6("Bucket 6 (polymorphicPartition)<br />|RelationalPost<br />Deps: 10, 23, 25, 77, 82, 87, 92, 97, 102<br />ᐳRelationalPost<br /><br />1: PgSelect[36]<br />2: PgSelectRows[41]<br />ᐳ: 40, 42, 108, 112, 115"):::bucket
    Bucket7("Bucket 7 (polymorphicPartition)<br />|RelationalDivider<br />Deps: 10, 23, 25, 77, 82, 87, 92, 97, 102<br />ᐳRelationalDivider<br /><br />1: PgSelect[44]<br />2: PgSelectRows[49]<br />ᐳ: 48, 50, 109, 113"):::bucket
    Bucket8("Bucket 8 (polymorphicPartition)<br />|RelationalChecklist<br />Deps: 10, 23, 25, 77, 82, 87, 92, 97, 102<br />ᐳRelationalChecklist<br /><br />1: PgSelect[52]<br />2: PgSelectRows[57]<br />ᐳ: 56, 58, 110"):::bucket
    Bucket9("Bucket 9 (polymorphicPartition)<br />|RelationalChecklistItem<br />Deps: 10, 23, 25, 77, 82, 87, 92, 97, 102<br />ᐳRelationalChecklistItem<br /><br />1: PgSelect[60]<br />2: PgSelectRows[65]<br />ᐳ: 64, 66, 111, 114"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2
    Bucket2 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket5 & Bucket6 & Bucket7 & Bucket8 & Bucket9

    %% plan dependencies
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸpeopleᐳ<br />More deps:<br />- Object[10]<br />- Constantᐸundefinedᐳ[6]"]]:::plan
    PgSelectInlineApply116["PgSelectInlineApply[116∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[6]<br />- Constantᐸundefinedᐳ[6]"]:::plan
    PgSelectInlineApply116 --> PgSelect7
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 6"}}:::plan
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    PgSelectRows11[["PgSelectRows[11∈0] ➊"]]:::plan
    PgSelect7 --> PgSelectRows11
    Access117{{"Access[117∈0] ➊<br />ᐸ7.m.subqueryDetailsFor16ᐳ"}}:::plan
    PgSelect7 --> Access117
    __Item12[/"__Item[12∈1]<br />ᐸ11ᐳ"\]:::itemplan
    PgSelectRows11 ==> __Item12
    PgSelectSingle13{{"PgSelectSingle[13∈1]<br />ᐸpeopleᐳ"}}:::plan
    __Item12 --> PgSelectSingle13
    List118{{"List[118∈2]<br />ᐸ117,12ᐳ"}}:::plan
    Access117 & __Item12 --> List118
    PgClassExpression14{{"PgClassExpression[14∈2]<br />ᐸ__people__.”username”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression14
    PgSelectRows20[["PgSelectRows[20∈2]"]]:::plan
    Lambda119{{"Lambda[119∈2]<br />ᐸpgInlineViaSubqueryTransformᐳ"}}:::plan
    Lambda119 --> PgSelectRows20
    List118 --> Lambda119
    __Item21[/"__Item[21∈3]<br />ᐸ20ᐳ"\]:::itemplan
    PgSelectRows20 ==> __Item21
    PgSelectSingle22{{"PgSelectSingle[22∈3]<br />ᐸrelational_itemsᐳ"}}:::plan
    __Item21 --> PgSelectSingle22
    PgClassExpression23{{"PgClassExpression[23∈3]<br />ᐸ__relation...ems__.”id”ᐳ"}}:::plan
    PgSelectSingle22 --> PgClassExpression23
    PgClassExpression25{{"PgClassExpression[25∈3]<br />ᐸ__relation...s__.”type”ᐳ"}}:::plan
    PgSelectSingle22 --> PgClassExpression25
    Lambda26{{"Lambda[26∈3]<br />ᐸrelationalItemTypeNameFromTypeᐳ"}}:::plan
    PgClassExpression25 --> Lambda26
    PgClassExpression77{{"PgClassExpression[77∈3]<br />ᐸ__relation...__.”type2”ᐳ"}}:::plan
    PgSelectSingle22 --> PgClassExpression77
    PgClassExpression82{{"PgClassExpression[82∈3]<br />ᐸ__relation...”position”ᐳ"}}:::plan
    PgClassExpression77 o--o PgClassExpression82
    PgClassExpression87{{"PgClassExpression[87∈3]<br />ᐸ__relation...reated_at”ᐳ"}}:::plan
    PgClassExpression82 o--o PgClassExpression87
    PgClassExpression92{{"PgClassExpression[92∈3]<br />ᐸ__relation...pdated_at”ᐳ"}}:::plan
    PgClassExpression87 o--o PgClassExpression92
    PgClassExpression97{{"PgClassExpression[97∈3]<br />ᐸ__relation..._archived”ᐳ"}}:::plan
    PgClassExpression92 o--o PgClassExpression97
    PgClassExpression102{{"PgClassExpression[102∈3]<br />ᐸ__relation...chived_at”ᐳ"}}:::plan
    PgClassExpression97 o--o PgClassExpression102
    PgSelect28[["PgSelect[28∈5]<br />ᐸrelational_topicsᐳ<br />ᐳRelationalTopic<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression23 --> PgSelect28
    First32{{"First[32∈5]^"}}:::plan
    PgSelectRows33[["PgSelectRows[33∈5]^"]]:::plan
    PgSelectRows33 --> First32
    PgSelect28 --> PgSelectRows33
    PgSelectSingle34{{"PgSelectSingle[34∈5]^<br />ᐸrelational_topicsᐳ"}}:::plan
    First32 --> PgSelectSingle34
    PgClassExpression107{{"PgClassExpression[107∈5]^<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgSelectSingle34 --> PgClassExpression107
    PgSelect36[["PgSelect[36∈6]<br />ᐸrelational_postsᐳ<br />ᐳRelationalPost<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression23 --> PgSelect36
    First40{{"First[40∈6]^"}}:::plan
    PgSelectRows41[["PgSelectRows[41∈6]^"]]:::plan
    PgSelectRows41 --> First40
    PgSelect36 --> PgSelectRows41
    PgSelectSingle42{{"PgSelectSingle[42∈6]^<br />ᐸrelational_postsᐳ"}}:::plan
    First40 --> PgSelectSingle42
    PgClassExpression108{{"PgClassExpression[108∈6]^<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgSelectSingle42 --> PgClassExpression108
    PgClassExpression112{{"PgClassExpression[112∈6]^<br />ᐸ__relation...scription”ᐳ"}}:::plan
    PgClassExpression108 o--o PgClassExpression112
    PgClassExpression115{{"PgClassExpression[115∈6]^<br />ᐸ__relation...s__.”note”ᐳ"}}:::plan
    PgClassExpression112 o--o PgClassExpression115
    PgSelect44[["PgSelect[44∈7]<br />ᐸrelational_dividersᐳ<br />ᐳRelationalDivider<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression23 --> PgSelect44
    First48{{"First[48∈7]^"}}:::plan
    PgSelectRows49[["PgSelectRows[49∈7]^"]]:::plan
    PgSelectRows49 --> First48
    PgSelect44 --> PgSelectRows49
    PgSelectSingle50{{"PgSelectSingle[50∈7]^<br />ᐸrelational_dividersᐳ"}}:::plan
    First48 --> PgSelectSingle50
    PgClassExpression109{{"PgClassExpression[109∈7]^<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgSelectSingle50 --> PgClassExpression109
    PgClassExpression113{{"PgClassExpression[113∈7]^<br />ᐸ__relation...__.”color”ᐳ"}}:::plan
    PgClassExpression109 o--o PgClassExpression113
    PgSelect52[["PgSelect[52∈8]<br />ᐸrelational_checklistsᐳ<br />ᐳRelationalChecklist<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression23 --> PgSelect52
    First56{{"First[56∈8]^"}}:::plan
    PgSelectRows57[["PgSelectRows[57∈8]^"]]:::plan
    PgSelectRows57 --> First56
    PgSelect52 --> PgSelectRows57
    PgSelectSingle58{{"PgSelectSingle[58∈8]^<br />ᐸrelational_checklistsᐳ"}}:::plan
    First56 --> PgSelectSingle58
    PgClassExpression110{{"PgClassExpression[110∈8]^<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgSelectSingle58 --> PgClassExpression110
    PgSelect60[["PgSelect[60∈9]<br />ᐸrelational_checklist_itemsᐳ<br />ᐳRelationalChecklistItem<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression23 --> PgSelect60
    First64{{"First[64∈9]^"}}:::plan
    PgSelectRows65[["PgSelectRows[65∈9]^"]]:::plan
    PgSelectRows65 --> First64
    PgSelect60 --> PgSelectRows65
    PgSelectSingle66{{"PgSelectSingle[66∈9]^<br />ᐸrelational_checklist_itemsᐳ"}}:::plan
    First64 --> PgSelectSingle66
    PgClassExpression111{{"PgClassExpression[111∈9]^<br />ᐸ__relation...scription”ᐳ"}}:::plan
    PgSelectSingle66 --> PgClassExpression111
    PgClassExpression114{{"PgClassExpression[114∈9]^<br />ᐸ__relation...s__.”note”ᐳ"}}:::plan
    PgClassExpression111 o--o PgClassExpression114

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,PgSelectRows11,PgSelectInlineApply116,Access117 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,__Item12,PgSelectSingle13 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgClassExpression14,PgSelectRows20,List118,Lambda119 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item21,PgSelectSingle22,PgClassExpression23,PgClassExpression25,Lambda26,PgClassExpression77,PgClassExpression82,PgClassExpression87,PgClassExpression92,PgClassExpression97,PgClassExpression102 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgSelect28,First32,PgSelectRows33,PgSelectSingle34,PgClassExpression107 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgSelect36,First40,PgSelectRows41,PgSelectSingle42,PgClassExpression108,PgClassExpression112,PgClassExpression115 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgSelect44,First48,PgSelectRows49,PgSelectSingle50,PgClassExpression109,PgClassExpression113 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8,PgSelect52,First56,PgSelectRows57,PgSelectSingle58,PgClassExpression110 bucket8
    classDef bucket9 stroke:#ff0000
    class Bucket9,PgSelect60,First64,PgSelectRows65,PgSelectSingle66,PgClassExpression111,PgClassExpression114 bucket9

